package com.lzhsite.technology.designPattern.strategy.LogTemplateDemo;

public class LogContext {
	public void log(String logMessage) {
		LogStrategy strategy = new DBLog();
		try {
			//这里进行了策略的选择吧try-catch变相当if else用了
			strategy.log(logMessage);
		} catch (Exception exception) {
			strategy = new FileLog();
			strategy.log(logMessage);
		}
	}
}
